/**********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       directionalblur.frag
 * Author:     karooolek
 * Created on: 2009-12-10
 *
 **********************************************************************************************************************/

STRINGIZE(

uniform sampler2D texture;
uniform vec2 direction;

void main()
{
    // get samples
    vec2 p = gl_TexCoord[0].st - direction;
    vec2 dp = direction.st / 5;
    vec4 tex =    0.050 * texture2D(texture, p);
    tex +=        0.100 * texture2D(texture, p += dp);
    tex +=        0.250 * texture2D(texture, p += dp);
    tex +=        0.450 * texture2D(texture, p += dp);
    tex +=        0.700 * texture2D(texture, p += dp);
    tex +=        1.000 * texture2D(texture, p += dp);
    tex +=        0.700 * texture2D(texture, p += dp);
    tex +=        0.450 * texture2D(texture, p += dp);
    tex +=        0.250 * texture2D(texture, p += dp);
    tex +=        0.100 * texture2D(texture, p += dp);
    tex +=        0.050 * texture2D(texture, p += dp);
    tex /=        4.100;
    
    gl_FragColor = tex;
}

) // STRINGIZE
